﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MathsLibrary
{
    class Program
    {
        enum Vybor { Fig, Numb }
        static void Main(string[] args)
        {
            Vybor[] mas = new Vybor[2];
            mas[0] = Vybor.Numb;
            mas[1] = Vybor.Fig;
            switch (mas[0])
            {
                case Vybor.Numb:
                    int num = 0;
                    Numbers.Chetn(num);
                    Console.WriteLine(Numbers.SecondPower(num) + " is square of {0}", num);
                    Numbers.Binary(num);
                    Numbers.Positivity(num);
                    if (num <= 0)
                    {
                        Console.WriteLine("Less then 0 or =0");
                        return;
                    }
                    if (Numbers.Simple(num)) Console.WriteLine(num + " is prime number");
                    else Console.WriteLine("{0} is composite number", num);
                    break;
                case Vybor.Fig:
                    double diam = 3.0;
                    double side = 3.0;
                    double side1 = 2.0;
                    double side2 = 3.0;
                    if (diam < 0)
                    {
                        Console.WriteLine("\n\tdiameter can't be less than 0!");
                        goto A1;
                    }
                    else
                    {
                        Console.WriteLine("\n\t{0:#.###} is length of a circle with diameter {1}", Figures.CircleLength(diam), diam);
                        Console.WriteLine("\n\t{0:#.###} is square of a circle with diameter {1}", Figures.CircleSquare(diam), diam);
                    }
                A1: if (side < 0)
                    {
                        Console.WriteLine("\n\tside can't be less than 0!");
                        goto A2;
                    }
                    else
                    {
                        Console.WriteLine("\n\t{0:#.###} is square of a square with sides {1}", Figures.SquareSq(side), side);
                        Console.WriteLine("\n\t{0:#.###} is perimeter of a square with sides {1}", Figures.SquarePerim(side), side);
                    }
                A2: if ((side1 * side2) < 0)
                    {
                        Console.WriteLine("\n\tone of sides is less than 0!");
                    }
                    else
                    {
                        Console.WriteLine("\n\t{0:#.###} is square of rectangle with sides {1} and {2}", Figures.RectSquare(side1, side2), side1, side2);
                        Console.WriteLine("\n\t{0:#.###} is perimeter of rectangle with sides {0} and {1}", Figures.RectPerim(side1, side2), side1, side2);
                    }
                    break; 
            }
        Console.ReadLine();
        }
    }
}
